if (self.CavalryLogger) { CavalryLogger.start_js(["CpSck"]); } __d("AjaxError",[],(function(a,b,c,d,e,f){a={ERROR:"ar:error",TIMEOUT:"ar:timeout",PROXY_ERROR:"ar:proxy error",TRANSPORT_ERROR:"ar:transport error",SERVER_ERROR:"ar:http error",PARSE_ERROR:"ar:parse error",SERVICE_UNAVAILABLE:"ar:noservice"};e.exports=a}),null); __d("AjaxRequest",["AjaxError","ErrorUtils","Keys","PHPQuerySerializer","TimeSlice","URI","UserAgent_DEPRECATED","ZeroRewrites","clearTimeout","setTimeoutAcrossTransitions"],(function(a,b,c,d,e,f){__p&&__p();var g=window.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest(),h=[];function a(){var a=h;h=[];a.forEach(function(a){return a.abort()})}function i(a){a.onJSON=a.onError=a.onSuccess=null,b("clearTimeout")(a._timer),a.xhr&&a.xhr.readyState<4&&(a.xhr.abort(),a.xhr=null),h=h.filter(function(b){return b&&b!=a&&b.xhr&&b.xhr.readyState<4})}c=function(){"use strict";__p&&__p();function a(a,c,d){this.timeout=6e4,this.streamMode=!0,this.prelude=/^for \(;;\);/,this.status=null,this.$1=-1,this.$2=null,this.$3=0,this.$4=null,this.json=null,this.errorType=null,this.errorText=null,this.onJSON=null,this.onSuccess=null,this.onError=null,c instanceof b("URI")||(c=new(b("URI"))(c)),this.xhr=b("ZeroRewrites").getTransportBuilderForURI(c)(),d&&a=="GET"&&c.setQueryData(d),this.method=a,this.uri=c,this.xhr.open(a,c)}a.supportsCORS=function(){return g};var c=a.prototype;c.send=function(a){__p&&__p();var c=this,d=b("TimeSlice").getReusableContinuation("AjaxRequest xhr.onreadystatechange");this.xhr.onreadystatechange=function(){return c.$5(d)};var e=this.timeout;e&&(this.$2=b("setTimeoutAcrossTransitions")(function(){c.errorType=b("AjaxError").TIMEOUT,c.errorText="timeout",c.$4=Date.now()-c.$3,c.onError&&c.onError(c),i(c)},e));h.push(this);this.method=="POST"&&this.xhr.setRequestHeader("Content-Type","application/x-www-form-urlencoded");this.$3=Date.now();this.xhr.send(a?b("PHPQuerySerializer").serialize(a):"")};c.abort=function(){i(this)};c.toString=function(){var a="[AjaxRequest readyState="+this.xhr.readyState;this.errorType&&(a+=" errorType="+this.errorType,this.errorText&&(a+=" ("+this.errorText+")"));return a+"]"};c.toJSON=function(){var a={};this.json&&(a.json=this.json);this.status&&(a.status=this.status);this.errorType&&(a.errorType=this.errorType,a.uri=this.uri);this.errorText&&(a.errorText=this.errorText);this.$4&&(a.time=this.$4);return a};c.onJSONSafe=function(){this.onJSON&&this.onJSON(this)};c.onSuccessSafe=function(){this.onSuccess&&this.onSuccess(this)};c.onErrorSafe=function(){this.onError&&this.onError(this)};c.$6=function(){__p&&__p();var a;try{this.status=this.xhr.status,a=this.xhr.statusText}catch(a){this.xhr.readyState>=4&&(this.errorType=b("AjaxError").TRANSPORT_ERROR,this.errorText=a.message);return}var c=this.status;if(c==null){this.errorType=b("AjaxError").ERROR;this.errorText="null status code";return}if(c===0&&!/^(file|ftp)/.test(this.uri.toString()))this.errorType=b("AjaxError").TRANSPORT_ERROR;else if(c>=100&&c<200)this.errorType=b("AjaxError").PROXY_ERROR;else if(c>=200&&c<300)return;else if(c>=300&&c<400)this.errorType=b("AjaxError").PROXY_ERROR;else if(c>=400&&c<500)this.errorType=b("AjaxError").SERVER_ERROR;else if(c===503)this.errorType=b("AjaxError").SERVICE_UNAVAILABLE;else if(c>500&&c<600)this.errorType=b("AjaxError").PROXY_ERROR;else if(c==1223)return;else c>=12001&&c<=12156?this.errorType=b("AjaxError").TRANSPORT_ERROR:(a="unrecognized status code: "+c,this.errorType=b("AjaxError").ERROR);this.errorText||(this.errorText=a)};c.$7=function(){__p&&__p();var a,c=this.xhr.readyState;try{a=this.xhr.responseText||""}catch(a){c>=4&&(this.errorType=b("AjaxError").ERROR,this.errorText="responseText not available - "+a.message);return}while(this.xhr){var d=this.$1+1,e=this.streamMode?a.indexOf("\n",d):a.length;e<0&&c==4&&(e=a.length);if(e<=this.$1)break;var f=a;this.streamMode&&(f=a.substr(d,e-d).replace(/^\s*|\s*$/g,""));if(d===0&&this.prelude){var g=this.prelude;g.test(f)&&(f=f.replace(g,""))}this.$1=e;if(f){try{this.json=JSON.parse(f)}catch(c){g=a.match(/()/i);e=g!=null&&g.length>0?g[0]:null;g={message:c.message,"char":d,excerpt:(d===0&&e||f).substr(512)};this.errorType=b("AjaxError").PARSE_ERROR;this.errorText="parse error - "+JSON.stringify(g);return}b("ErrorUtils").applyWithGuard(this.onJSONSafe,this)}}};c.$5=function(a){var b=this,c=this.xhr&&this.xhr.readyState||0;this.status==null&&c>=2&&this.$6();!this.errorType&&this.status!=null&&((c===3&&this.streamMode||c===4)&&a(function(){return b.$7()}));(this.errorType||c===4)&&(this.$4=Date.now()-this.$3,a.last(function(){b.errorType?b.onErrorSafe():b.onSuccessSafe(),i(b)}))};return a}();window.addEventListener&&b("UserAgent_DEPRECATED").firefox()&&window.addEventListener("keydown",function(a){a.keyCode===b("Keys").ESC&&a.prevent()},!1);window.attachEvent&&window.attachEvent("onunload",a);e.exports=c}),null); __d("ChannelSubdomain",["Event","JSLogger","Run","LogHistory","clearTimeout","setTimeoutAcrossTransitions","WebStorage"],(function(a,b,c,d,e,f){__p&&__p();var g=b("LogHistory").getInstance("channel"),h=b("JSLogger").create("channel"),i="channel_sub:",j=7,k=100*1e3,l=null,m=null;function n(){var a=b("WebStorage").getLocalStorage();m&&(b("clearTimeout")(m),m=null);a&&l!=null&&a.removeItem(i+l);l=null}function a(a,c,d){__p&&__p();d===void 0&&(d=!1);a=(a-1)*j;d&&(m&&b("clearTimeout")(m),l=m=null);c==null&&(c=Math.floor(Math.random()*a));if(l==null){var e=b("WebStorage").getLocalStorage();if(e){d=[];for(var f=0;f6&&(a.subdomain=0))};d.timeout=a.P_TIMEOUT;d.onSuccess=function(a){b("BanzaiODS").bumpEntityKey(2966,"ChannelTransport","sendP.success"),e(a)};d.send()}function n(a,c,d){__p&&__p();var e=new Image(),f=0,g=function(a){e.abort();return a?c():d()};e.onload=b("TimeSlice").guard(function(){h.log("ping_ok",{duration:Date.now()-f}),b("BanzaiODS").bumpEntityKey(2966,"ChannelTransport","sendPing.success"),g(!0)},"ChannelTransport image.onload");e.onerror=b("TimeSlice").guard(function(){m(a),b("BanzaiODS").bumpEntityKey(2966,"ChannelTransport","sendPing.error"),i(e),g(!1)},"ChannelTransport image.onerror");var k=b("setTimeoutAcrossTransitions")(e.onerror,1e4);e.abort=function(){k&&(b("clearTimeout")(k),k=null),e.onload=e.onerror=null};var n={partition:a.partition,cb:j()};a.sticky_token&&(n.sticky_token=a.sticky_token);a.sticky_pool&&(n.sticky_pool=a.sticky_pool);a.lastRequestErrorReason&&(n.reason=a.lastRequestErrorReason,a.lastRequestErrorReason=null);a.uid&&a.viewerUid&&(n.uid=a.uid,n.viewer_uid=a.viewerUid);f=Date.now();e.src=l(a,"/ajax/chatproxy-ping").setQueryData(n);return e}function a(a,c){__p&&__p();var d={channel:a.user_channel,partition:a.partition,clientid:a.sessionID,cb:j(),cap:0,uid:a.uid,viewer_uid:a.viewerUid};a.sticky_token&&(d.sticky_token=a.sticky_token);a.sticky_pool&&(d.sticky_pool=a.sticky_pool);a.profile&&(d.profile=a.profile);a.capabilities&&(d.cap=a.capabilities);d.id=c;c=l(a,"/add_bud").setQueryData(d);var e=new(b("AjaxRequest"))("GET",c);b("AjaxRequest").supportsCORS()&&(e.xhr.withCredentials=!0);e.onError=function(a){b("BanzaiODS").bumpEntityKey(2966,"ChannelTransport","sendAdditionalBuddy.error"),h.warn("add_buddy_error"),i(e)};e.onSuccess=function(a){b("BanzaiODS").bumpEntityKey(2966,"ChannelTransport","sendAdditionalBuddy.success"),h.log("add_buddy_ok")};e.timeout=a.P_TIMEOUT;e.send()}function c(a){__p&&__p();var c={channel:a.user_channel,partition:a.partition,clientid:a.sessionID,cb:j(),cap:0,uid:a.uid,viewer_uid:a.viewerUid};a.sticky_token&&(c.sticky_token=a.sticky_token);a.sticky_pool&&(c.sticky_pool=a.sticky_pool);a.is_offline||a.shouldSuppressPresence?c.state="offline":c.state="active";if(c.state===a.lastPresenceState)return;a.lastPresenceState=c.state;a.profile&&(c.profile=a.profile);a.capabilities&&(c.cap=a.capabilities);c=l(a,"/active_ping").setQueryData(c);var d=new(b("AjaxRequest"))("GET",c);b("AjaxRequest").supportsCORS()&&(d.xhr.withCredentials=!0);d.onError=function(a){b("BanzaiODS").bumpEntityKey(2966,"ChannelTransport","sendActivePing.error"),h.warn("active_ping_error"),i(d)};d.onSuccess=function(a){b("BanzaiODS").bumpEntityKey(2966,"ChannelTransport","sendActivePing.success"),h.log("active_ping_ok")};d.timeout=a.P_TIMEOUT;d.send()}function o(a,c,d,e){__p&&__p();var f=new Date(),g=-1;a.userActive>0&&(g=(f-a.userActive)/1e3|0,g<0&&h.warn("idle_regression",{idleTime:g,now:f.getTime(),userActive:a.userActive}));f={channel:a.user_channel,seq:a.seq,partition:a.partition,clientid:a.sessionID,cb:j(),idle:g,qp:"y",cap:0};a.state.aiq&&(f.aiq=a.state.aiq);b("gkx")("719214")&&(f.iris_enabled=!b("MessengerMQTTGating").isEnabled(),b("BanzaiODS").bumpEntityKey(2966,"ChannelTransport","iris_enabled."+(f.iris_enabled?"true":"false")));a.ready&&((a.seqTurSentAt==-1||a.seqTurSentAt==a.seq)&&(f.tur=a.timeUntilReady,f.qpmade=a.queueMade,a.seqTurSentAt=a.seq));f.pws=a.pws;a.sequenceId>0&&(f.isq=a.sequenceId);f.msgs_recv=a.estimatedReceived;a.uid&&a.viewerUid&&(f.uid=a.uid,f.viewer_uid=a.viewerUid);a.sticky_token?f.sticky_token=a.sticky_token:(f.request_batch=1,a.msgr_region&&(f.msgr_region=a.msgr_region));a.sticky_pool&&(f.sticky_pool=a.sticky_pool);"trace_id"in a&&(f.traceid=a.trace_id);a.is_offline||a.shouldSuppressPresence?f.state="offline":a.userActive>0&&g<60&&(f.state="active");a.lastPresenceState=f.state;a.streamingCapable&&(f.mode="stream",f.format="json");a.profile&&(f.profile=a.profile);a.capabilities&&(f.cap=a.capabilities);g=l(a,"/pull").setQueryData(f);f="GET";var k=new(b("AjaxRequest"))(f,g);b("AjaxRequest").supportsCORS()&&(k.xhr.withCredentials=!0);k.timeout=a.streamingCapable?a.STREAMING_TIMEOUT:a.LONGPOLL_TIMEOUT;k.onJSON=function(a){b("BanzaiODS").bumpEntityKey(2966,"ChannelTransport","sendPull.json"),c(a)};k.onSuccess=function(a){b("BanzaiODS").bumpEntityKey(2966,"ChannelTransport","sendPull.success"),d(a)};k.onError=function(){var c=this.status==12002&&this._time>=a.MIN_12002_TIMEOUT||this.status==504&&this._time>=a.MIN_504_TIMEOUT,f=c?d:e;c?b("BanzaiODS").bumpEntityKey(2966,"ChannelTransport","sendPull.success"):(b("BanzaiODS").bumpEntityKey(2966,"ChannelTransport","sendPull.error"),i(k));return f&&f.apply(this,arguments)};k.send();a.inStreaming=a.streamingCapable;return k}function p(a){this.manager=a,this.init&&this.init()}function d(a){p.apply(this,arguments)}Object.assign(d.prototype,{logName:"CORS",enterState:function(a,c){this._request&&(this._request.abort(),this._request=null);a=="init"&&b("setTimeoutAcrossTransitions")(b("bind")(this.manager,"exitState",{status:b("ChannelConstants").OK,stateId:c.stateId}),0);if(!/pull|ping/.test(a))return;var d=this.manager;a=="ping"?this._request=n(c,b("bind")(d,"exitState",{status:b("ChannelConstants").OK,stateId:c.stateId}),b("bind")(d,"exitState",{status:b("ChannelConstants").ERROR,stateId:c.stateId})):a=="pull"&&(this._request=o(c,b("bind")(d,"_processTransportData",c.stateId),b("bind")(d,"exitState",{status:b("ChannelConstants").OK,stateId:c.stateId}),b("bind")(d,"exitState",{status:b("ChannelConstants").ERROR,stateId:c.stateId})))}});function f(a){h.log("iframe_init_constructor"),p.apply(this,arguments),this._iframe=document.createElement("iframe"),this._iframe.style.display="none",document.body.appendChild(this._iframe),b("DocRPC").publish(this,"outerTransport")}Object.assign(f.prototype,{logName:"iframe",_initIframe:function(a){__p&&__p();h.log("iframe_init_start");window.onchanneliframeready=function(){h.log("iframe_resources");return a.resources};window.onchanneliframeloaded=function(){h.log("iframe_loaded")};if(a){this._iframeURI=l(a,a.path);if(a.resources){var c=this._iframeURI.getDomain();a.resources=a.resources.map(function(a){var d=new(b("URI"))(a);return d.getPath().startsWith("/intern/rsrc.php")&&d.getQueryData().origin!==void 0?d.addQueryData("origin",c).toString():a})}}else this._iframeURI="about:blank";this._iframeProxy=null;try{this._iframe.contentWindow.location.replace(this._iframeURI),h.log("iframe_uri_set")}catch(c){h.error("iframe_uri_set_error",c),this.exitState({status:b("ChannelConstants").ERROR,stateId:a.stateId},c+"")}},enterState:function(a,c){a=="init"?this._initIframe(c):/idle|ping|pull/.test(a)?this._iframeProxy?this._iframeProxy.enterState.apply(this._iframeProxy,arguments):a!="idle"&&this.exitState({status:b("ChannelConstants").ERROR,stateId:c.stateId},"iframe not yet loaded"):a=="shutdown"&&this._initIframe()},_processTransportData:function(){this.manager._processTransportData.apply(this.manager,arguments)},exitState:function(a){this.manager.state=="init"&&a.status==b("ChannelConstants").OK&&(this._iframeProxy=b("DocRPC").proxy(this._iframe.contentWindow,"innerTransport",["enterState"],(this._iframeURI+"").replace(/iframe.*/,"")));if(/ping|pull/.test(this.manager.state)&&!this._iframeProxy)return;this.manager.exitState.apply(this.manager,arguments)}});function q(){this.init=this.init.bind(this),p.apply(this,arguments)}Object.assign(q.prototype,{logName:"iframe(inner)",init:function(){b("DocRPC").publish(this,"innerTransport");try{var a=b("DocRPC").proxy(window.parent,"outerTransport",["_processTransportData","exitState"],top.DocRPC.origin);Object.assign(this,a);this.exitState({status:b("ChannelConstants").OK,stateId:1e6})}catch(a){h.error("iframe_inner_init_error",a)}},enterState:function(a,c){this._request&&(this._request.abort(),this._request=null),a=="ping"?this._request=n(c,b("bind")(this,"exitState",{status:b("ChannelConstants").OK,stateId:c.stateId}),b("bind")(this,"exitState",{status:b("ChannelConstants").ERROR,stateId:c.stateId})):a=="pull"&&(this._request=o(c,b("bind")(this,"_processTransportData",c.stateId),b("bind")(this,"exitState",{status:b("ChannelConstants").OK,stateId:c.stateId}),b("bind")(this,"exitState",{status:b("ChannelConstants").ERROR,stateId:c.stateId})))}});e.exports={isSubdomain:k,getURI:l,Transport:p,CORSTransport:d,IframeTransport:f,IframeInnerTransport:q,sendActivePing:c,sendAdditionalBuddyRequest:a}}),null); __d("ChatProxyConnectionState",[],(function(a,b,c,d,e,f){"use strict";__p&&__p();a=function(){__p&&__p();function a(){this.auxiliaryIrisQueues={},this.aiq=null}var b=a.prototype;b.subscribeIrisQueue=function(a,b){this.auxiliaryIrisQueues[a]=b,this.updateCaches()};b.unsubscribeIrisQueue=function(a){delete this.auxiliaryIrisQueues[a],this.updateCaches()};b.updateCaches=function(){var a=[];for(var b in this.auxiliaryIrisQueues)Object.prototype.hasOwnProperty.call(this.auxiliaryIrisQueues,b)&&(a.push(b),a.push(this.auxiliaryIrisQueues[b]));a.length===0?this.aiq=null:this.aiq=a.join(",")};return a}();e.exports=a}),null); __d("FBAjaxRequest",["AjaxError","AjaxRequest","getAsyncParams"],(function(a,b,c,d,e,f){__p&&__p();a=function(a){"use strict";__p&&__p();babelHelpers.inheritsLoose(c,a);function c(c,d,e){e=babelHelpers["extends"]({},b("getAsyncParams")(c),e);c=a.call(this,c,d,e)||this;c.$FBAjaxRequest1=e;c.streamMode=!1;return c}var d=c.prototype;d.onJSONSafe=function(){this.json&&(this.json.error&&(this.errorType=b("AjaxError").SERVER_ERROR,this.errorText="AsyncResponse error: "+this.json.error),this.json=this.json.payload),a.prototype.onJSONSafe.call(this)};d.send=function(b){a.prototype.send.call(this,babelHelpers["extends"]({},b,this.$FBAjaxRequest1))};return c}(b("AjaxRequest"));e.exports=a}),null); __d("MovingStat",[],(function(a,b,c,d,e,f){__p&&__p();a=function(){"use strict";__p&&__p();function a(a){this.$1=a>0?a:6e4,this.$2=0,this.$3=0,this.$5={t:new Date(),count:0,v:0},this.$4=this.$5}var b=a.prototype;b.add=function(a){__p&&__p();this.$2+=a;this.$3++;var b=new Date();if(b-this.$5.t<1e3){this.$5.v+=a;this.$5.count++;return}this.$5.next={t:b,v:a,count:1};this.$5=this.$5.next;this.$6()};b.tally=function(a){a===void 0&&(a=1e3);this.$6();return{sum:this.$2,count:this.$3,timeAverage:this.$2*a/this.$1}};b.$6=function(){var a=new Date()-this.$1;while(this.$4&&this.$4.next&&this.$4.t=f&&(this._throttled||(this._throttled=!0,i.warn("throttled","{}"),b("Arbiter").inform(b("ChannelConstants").THROTTLED,e)),h.bump("throttle"),d=1e3/f)}}else/#$/.test(a)||(d=this._getDelay());a=a.replace(/\W*$/,"");if(!o[a]){b("FantailLogger").error(b("ChannelConstants").FANTAIL_SERVICE,"invalid state: %s",a);throw new Error("invalid state:"+a)}var g=Array.from(arguments),j={};if(d<=0){j.state=a;this._transportRate&&this._transportRate.add(1);this.state=a;var k=this["_enter_"+this.state];k&&(g.shift(),k.apply(this,g));/init|idle|pull|ping/.test(this.state)&&(p.streamingCapable&&/pull/.test(this.state)&&(this.heartbeats=[]),p.is_offline=!b("ChatVisibility").isOnline(),p.capabilities=b("PresenceProperties").getProperties(),b("FantailLogger").info(b("ChannelConstants").FANTAIL_SERVICE,"entering transport state: %s",this.state),!this.transport?(n.then(function(a){return a.enterState(c.state,p)}),b("ChatReliabilityInstrumentation").logERROR("called enterState "+a+" before transport init")):this.transport.enterState(this.state,p),this.state=="ping"&&(j.url=b("ChannelTransport").getURI(p).toString(),j.port=p.port||"undefined"))}else this.state="idle",this.nextState=a,j.state=this.state,j.delay=d,j.nextState=a,g[0]=a+"#",this._deferredTransition=b("setTimeoutAcrossTransitions")(function(){c._deferredTransition=null,c.enterState.apply(c,g)},d);/pull/.test(a)&&(j.client_id=p.sessionID,j.streaming=p.inStreaming);b("Arbiter").inform(b("ChannelConstants").ON_ENTER_STATE,j)},exitState:function(a,c){__p&&__p();var d=a.stateId,e=a.status;if(this.isShutdown()||d0&&(j=g-this.heartbeats[this.heartbeats.length-1]);i.log("heartbeat_interval",JSON.stringify({client_id:p.sessionID,interval:j}));this.heartbeats.push(g)}break;case"batched":h=d.batches;for(var f=0;f=c){var f=a[e];if(f.type){b("BanzaiODS").bumpEntityKey(2966,"ChannelManager","messageReceive."+f.type);if(b("DesktopWebMessageTypesSitevarConfig").ChatProxySupportedMessageTypes.get(f.type)!==!0){b("BanzaiODS").bumpEntityKey(2966,"ChannelManager","processMessages.dropped."+f.type);continue}var g=b("ChannelConstants").getArbiterType(f.type);f.type==="skywalker"?g=b("ChannelConstants").SKYWALKER:f.type==="qprimer"?(f.first=!p.ready,f.first&&(p.ready=!0,p.timeUntilReady=Date.now()-p.created,p.queueMade=f.made),g=b("ChannelConstants").CHANNEL_ESTABLISHED):f.type==="delta"&&(p.sequenceId=f.iseq);try{f.type=="buddylist_overlay"&&f.buffered==1?k?b("BanzaiODS").bumpEntityKey(2966,"ChannelManager","processMessages.buddylist_overlay.dropped"):(g=b("ChannelConstants").getArbiterType("buddylist_overlay_buffered"),b("Arbiter").inform(g,{obj:f},"persistent")):j&&b("DesktopWebMessageTypesSitevarConfig").MQTTMigrationExcludeMessageTypes.get(f.type)!==!0?b("BanzaiODS").bumpEntityKey(2966,"ChannelManager","processMessages.migration.list."+f.type):b("Arbiter").inform(g,{obj:f})}catch(a){b("BanzaiODS").bumpEntityKey(2966,"ChannelManager","processMessages.error."+f.type),b("FantailLogger").info(b("ChannelConstants").FANTAIL_SERVICE,"message threw exception: %s %s",a,f)}}}else i.warn("seq_regression",JSON.stringify({last_seq:c,messages:a.length,seq:d}))}},_enter_init:function(){var a=this;if(r.init>=this.getConfig("MAX_INIT_FAILS",2))return b("setTimeoutAcrossTransitions")(function(){return a.exitState({status:b("ChannelConstants").ERROR_MAX,stateId:q})},0);this._initTimer=b("setTimeoutAcrossTransitions")(function(){return a.exitState({status:b("ChannelConstants").ERROR,stateId:q},"timeout")},p.IFRAME_LOAD_TIMEOUT)},_enter_reconnect:function(a){__p&&__p();var c=this;i.warn("enter_reconnect",a);b("FantailLogger").info(b("ChannelConstants").FANTAIL_SERVICE,"entered reconnect with reason: %s",a);var d=q;if(!b("PresenceUtil").hasUserCookie()){b("FantailLogger").warn(b("ChannelConstants").FANTAIL_SERVICE,"user has no cookie???");i.warn("no_user_cookie","{}");b("setTimeoutAcrossTransitions")(function(){c._shutdownHint=b("ChannelConstants").HINT_AUTH,c.exitState({status:b("ChannelConstants").ERROR_SHUTDOWN,stateId:d})},0);return}var e={};e.reason=a;e.fb_dtsg=b("DTSG").getToken();b("ISB").token&&(e.fb_isb=b("ISB").token);l&&l(e);var f=new(b("FBAjaxRequest"))("GET","/ajax/presence/reconnect.php",e);f.onSuccess=function(){c.configure(f.json),b("PresenceCookieManager").store(),c.exitState({status:b("ChannelConstants").OK,stateId:d})};f.onError=function(){var a=f.json&&f.json.error;b("FantailLogger").error(b("ChannelConstants").FANTAIL_SERVICE,"reconnect error: %s",f.errorType);(f.errorType==b("AjaxError").TRANSPORT_ERROR||f.errorType==b("AjaxError").PROXY_ERROR||f.errorType==b("AjaxError").SERVICE_UNAVAILABLE)&&(c._shutdownHint=b("ChannelConstants").HINT_CONN);a&&a==1356007?c._shutdownHint=b("ChannelConstants").HINT_MAINT:a==1357001||a==1357004||a==1348009?c._shutdownHint=b("ChannelConstants").HINT_AUTH:c._shutdownHint=null;c.exitState({status:c._shutdownHint?b("ChannelConstants").ERROR_SHUTDOWN:b("ChannelConstants").ERROR,stateId:d},f)};f.send()},_enter_shutdown:function(){var a=this;b("Arbiter").inform(b("ChannelConstants").ON_SHUTDOWN,{reason:this._shutdownHint});if("shutdown_recovery_interval_seconds"in p&&p.shutdown_recovery_interval_seconds>0){var c=p.shutdown_recovery_interval_seconds*1e3;b("setTimeoutAcrossTransitions")(function(){b("Arbiter").inform(b("ChannelConstants").ATTEMPT_RECONNECT),a._shutdownHint=null,a.state="reconnect!",a.enterState("reconnect!")},c)}},_exit_init:function(a){this._initTimer&&(this._initTimer=b("clearTimeout")(this._initTimer)),a==b("ChannelConstants").ERROR_MAX&&this._sendIframeError(b("ChannelConstants").reason_IFrameLoadGiveUp)},_exit_pull:function(a,c){if(a===b("ChannelConstants").OK){this.lastPullTime=Date.now();return}a="exit status: "+a;c&&c.errorType&&(a+=" ajax request error: "+c.errorType);b("FantailLogger").error(b("ChannelConstants").FANTAIL_SERVICE,"pull failed with status: %s",a)},_exit_ping:function(a){if(a!==b("ChannelConstants").OK){b("FantailLogger").error(b("ChannelConstants").FANTAIL_SERVICE,"ping failed with status: %s",a);return}a=Date.now()-(this.lastPullTime||b("Env").start);if(a>p.STALL_THRESHOLD){b("FantailLogger").error(b("ChannelConstants").FANTAIL_SERVICE,"didnt complete a successful pull for too long");return b("ChannelConstants").ERROR_STALE}},_reportProxyMisguidedMsg:function(a,c){__p&&__p();b("FantailLogger").error(b("ChannelConstants").FANTAIL_SERVICE,"misguided message to %s meant for %s",c,a);var d=Date.now();if(d-this.lastReportOnMisguidedMsgTime<=p.CHANNEL_PROXY_REPORTING_MIN_INTERVAL)return;this.lastReportOnMisguidedMsgTime=d;d={};d.received_uid=a;d.expected_uid=c;p.sticky_token&&(d.sticky_token=p.sticky_token);a=new(b("URI"))("/err_misguided_msg").setDomain(p.host+"."+p.domain).setPort(p.port).setSecure(new(b("URI"))(window.location.href).isSecure()).setQueryData(d);c=new(b("AjaxRequest"))("GET",a);b("AjaxRequest").supportsCORS()&&(c.xhr.withCredentials=!0);c.onSuccess=function(a){};c.onError=function(a){};c.onJSON=function(a){};c.send()},_initMonitors:function(){__p&&__p();var a=this,c=Date.now(),d=Date.now(),e={};e.total=0;var f="idle",g=!1;b("SystemEvents").subscribe([b("SystemEvents").USER,b("SystemEvents").ONLINE,b("SystemEvents").TIME_TRAVEL],function(c,e){__p&&__p();w(!0);d=null;a.lastPullTime=Date.now();var f;switch(c){case b("SystemEvents").USER:f=b("SystemEvents").isPageOwner()?b("ChannelConstants").SYS_OWNER:b("ChannelConstants").SYS_NONOWNER;break;case b("SystemEvents").ONLINE:f=e?b("ChannelConstants").SYS_ONLINE:b("ChannelConstants").SYS_OFFLINE;break;case b("SystemEvents").TIME_TRAVEL:if(p.skipTimeTravel)return;if(00&&(e[f]=(e[f]||0)+g,e.total+=g)}f=j;d=h;a||(e.lastSuccessTime=t(),e.online=b("SystemEvents").isOnline(),i.log("rollup",JSON.stringify(e)))};b("Arbiter").subscribe(b("ChannelConstants").ON_ENTER_STATE,h);b("setIntervalAcrossTransitions")(h,6e4);b("Arbiter").subscribe(b("JSLogger").DUMP_EVENT,function(a,b){b.channelRollup=e});h=function(){__p&&__p();if(a.isShutdown()||a.shouldIdle())return;b("SystemEvents").checkTimeTravel();var d=Date.now()-(a.lastPullTime||b("Env").start);if(!g&&d>p.STALL_THRESHOLD){var e=t();i.error("stall",JSON.stringify({lastSuccessTime:e,rollupState:f}));b("ChatReliabilityInstrumentation").logCHANNEL_STALLED(d.toString());g=!0}e=Date.now()-(c||0);a.state=="pull"&&e>p.JUMPSTART_THRESHOLD&&(c=null,i.warn("jumpstart",JSON.stringify({state:a.state,dormant:e})),b("Arbiter").inform(b("ChannelConstants").JUMPSTART,e),a.enterState("init"))};b("setIntervalAcrossTransitions")(h,5e3)},_indicateLbInfoUpdated:function(a,c){var d=!b("AjaxRequest").supportsCORS(),e=b("ChannelTransport").isSubdomain(p.subdomain);!e||d?p.fullHost=p.host:p.fullHost=p.subdomain+"-"+p.host;b("FantailLogger").info(b("ChannelConstants").FANTAIL_SERVICE,"received lb info: %s at seq: %s{%s} with ".concat("sticky: %s/%s, subdomain: %s, fullHost: %s, state: %s,").concat(" source: %s, args: %s"),p.sessionID,p.seq,p.sequenceId,p.sticky_token,p.sticky_pool,p.subdomain,p.fullHost,this.state,a,c)},_probeTest:function(){__p&&__p();p.streamingCapable=!1;var a=[],c={};c.mode="stream";c.format="json";p.sticky_token&&(c.sticky_token=p.sticky_token);c=new(b("URI"))("/probe").setDomain(p.fullHost+"."+p.domain).setPort(p.port).setSecure(new(b("URI"))(window.location.href).isSecure()).setQueryData(c);b("BanzaiODS").bumpEntityKey(2966,"ChannelManager","probe.attempt");c=new(b("AjaxRequest"))("GET",c);c.onJSON=function(c,d){if(c&&c.json&&c.json.t==="heartbeat"){a.push(Date.now());if(a.length>=2){d=a[1]-a[0];d>=p.PROBE_HEARTBEATS_INTERVAL_LOW&&d<=p.PROBE_HEARTBEATS_INTERVAL_HIGH?(p.streamingCapable=!0,b("BanzaiODS").bumpEntityKey(2966,"ChannelManager","probe.switch_to_streaming"),i.log("switch_to_streaming","{}")):b("BanzaiODS").bumpEntityKey(2966,"ChannelManager","probe.failure.delayed")}}};c.onSuccess=function(c){a.length!=2&&(p.streamingCapable=!1,b("BanzaiODS").bumpEntityKey(2966,"ChannelManager","probe.failure.data_loss"),i.error("probe_error",JSON.stringify({error:"beats.length = "+a.length}))),b("BanzaiODS").bumpEntityKey(2966,"ChannelManager","probe.success"),i.log("probe_success","{}")};c.onError=function(a){p.streamingCapable=!1,b("BanzaiODS").bumpEntityKey(2966,"ChannelManager","probe.failure.error"),i.error("probe_error",JSON.stringify(a))};c.send()},_sseProbeTest:function(){__p&&__p();if(!window.EventSource){b("BanzaiODS").bumpEntityKey(2966,"ChannelManager","sse_probe.failure.no_event_source");i.log("sse_probe.failure.no_event_source","{}");return}var a=[],c={};c.mode="sse";c.format="json";p.sticky_token&&(c.sticky_token=p.sticky_token);c=new(b("URI"))("/sse_probe").setDomain(p.fullHost+"."+p.domain).setPort(p.port).setSecure(new(b("URI"))(window.location.href).isSecure()).setQueryData(c);b("BanzaiODS").bumpEntityKey(2966,"ChannelManager","sse_probe.attempt");var d=new EventSource(c.toString()),e=b("setTimeoutAcrossTransitions")(function(){d.close(),b("BanzaiODS").bumpEntityKey(2966,"ChannelManager","sse_probe.failure.timeout"),i.log("sse_probe.failure.timeout","{}")},p.PROBE_HEARTBEATS_INTERVAL_HIGH*6);d.addEventListener("heartbeat",function(c){a.push(Date.now());if(a.length>=2){c=a[1]-a[0];c>=p.PROBE_HEARTBEATS_INTERVAL_LOW&&c<=p.PROBE_HEARTBEATS_INTERVAL_HIGH?(b("BanzaiODS").bumpEntityKey(2966,"ChannelManager","sse_probe.success"),i.log("sse_probe.success","{}")):(b("BanzaiODS").bumpEntityKey(2966,"ChannelManager","sse_probe.failure.delayed"),i.log("sse_probe.failure.delayed","{}"));b("clearTimeout")(e);d.close()}});d.onerror=function(a){b("BanzaiODS").bumpEntityKey(2966,"ChannelManager","sse_probe.failure.error"),i.error("sse_probe.failure.error",JSON.stringify(a)),b("clearTimeout")(e),d.close()}},startChannelManagerForApp:function(a){this.startChannelManager!==b("emptyFunction")&&this.startChannelManager(),b("ChannelInitialData").channelConfig&&p&&(p.profile=a)},startChannelManager:function(){b("ChannelInitialData").channelConfig?(this.configure(b("ChannelInitialData").channelConfig),/shutdown/.test(b("ChannelInitialData").state)&&(this._shutdownHint=b("ChannelConstants")[b("ChannelInitialData").reason]),this.init(b("ChannelInitialData").state,b("ChannelInitialData").reason),j&&this._mqttInit(),b("ChatReliabilityInstrumentation").logCHANNEL_INIT(),this.startChannelManager=b("emptyFunction")):b("ChatReliabilityInstrumentation").logCHANNEL_NOCONFIG()}};e.exports=c}),null); __d("EmojiDispatcher",["ExplicitRegistrationDispatcher"],(function(a,b,c,d,e,f){"use strict";e.exports=new(b("ExplicitRegistrationDispatcher"))({strict:!1})}),null); __d("EmojiActions",["EmojiDispatcher","keyMirror"],(function(a,b,c,d,e,f){"use strict";__p&&__p();a=b("keyMirror")({CHANGE_CURRENT_CATEGORY:null,CHANGE_EMOJI_COLOR:null,EMOJI_COLOR_READY:null,GET_EMOJI_COLOR:null,TRAY_DATA_READY:null,UPDATE_TRAY_DATA:null});var g={Types:a,loadedTrayData:function(){b("EmojiDispatcher").dispatch({type:g.Types.TRAY_DATA_READY})},updateTrayData:function(){b("EmojiDispatcher").dispatch({type:g.Types.UPDATE_TRAY_DATA})},changeEmojiColor:function(a){b("EmojiDispatcher").dispatch({type:g.Types.CHANGE_EMOJI_COLOR,color:a})},changeCurrentCategory:function(a){b("EmojiDispatcher").dispatch({type:g.Types.CHANGE_CURRENT_CATEGORY,currentCategory:a})},getEmojiColor:function(){b("EmojiDispatcher").dispatch({type:g.Types.GET_EMOJI_COLOR})},emojiColorReady:function(a){b("EmojiDispatcher").dispatch({type:g.Types.EMOJI_COLOR_READY,color:a})}};e.exports=g}),null); __d("FBPaymentsDispatcher",["ExplicitRegistrationReactDispatcher"],(function(a,b,c,d,e,f){"use strict";a=function(a){babelHelpers.inheritsLoose(b,a);function b(b){b=a.call(this,b)||this;babelHelpers.assertThisInitialized(b).dispatch=b.dispatch.bind(babelHelpers.assertThisInitialized(b));return b}return b}(b("ExplicitRegistrationReactDispatcher"));e.exports=new a({strict:!1})}),null); __d("FBPaymentsDialogActions",["FBPaymentsDispatcher","keyMirror"],(function(a,b,c,d,e,f){"use strict";var g={types:b("keyMirror")({SHOW_DIALOG:null,HIDE_DIALOG:null}),showDialog:function(a,c){b("FBPaymentsDispatcher").dispatch({type:g.types.SHOW_DIALOG,data:{dialogClass:a,dialogProps:c}})},hideDialog:function(){b("FBPaymentsDispatcher").dispatch({type:g.types.HIDE_DIALOG,data:{}})}};e.exports=g}),null);